import request from '@/utils/request.js'

//  获取列表接口  /lejuAdmin/product/productsByPage/${start}/${limit}

function productsByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/product/productsByPage/${start}/${limit}`,
    method: 'post',
    data
  })
}

// 更改商品最新状态  /lejuAdmin/product/switchNewStatus
function switchNewStatus(data) {
  return request({
    url: '/lejuAdmin/product/switchNewStatus',
    method: 'post',
    data
  })
}
// 更改发布状态  /lejuAdmin/product/switchPublishStatus
function switchPublishStatus(data) {
  return request({
    url: '/lejuAdmin/product/switchPublishStatus',
    method: 'post',
    data
  })
}
// 更改推荐状态  /lejuAdmin/product/switchRecommandStatus
function switchRecommandStatus(data) {
  return request({
    url: '/lejuAdmin/product/switchRecommandStatus',
    method: 'post',
    data
  })
}
// 更改审核状态  /lejuAdmin/product/switchVerifyStatus
function switchVerifyStatus(data) {
  return request({
    url: '/lejuAdmin/product/switchVerifyStatus',
    method: 'post',
    data
  })
}
// 点击删除   /lejuAdmin/product/del
function del(id) {
  return request({
    url: `/lejuAdmin/product/del/${id}`,
    method: 'DELETE'
  })
}

export {
  productsByPage,
  switchNewStatus,
  switchPublishStatus,
  switchRecommandStatus,
  switchVerifyStatus,
  del
}
